package com.xish.api.shop;

import com.xish.api.shop.form.ShopEditForm;
import com.xish.model.bean.WzmShop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShopService {

    @Autowired
    private ShopRepository shopRepository;

    public WzmShop findById(int id) {
        return shopRepository.findById(id);
    }

    public WzmShop findByPoiId(int poiId) {
        return shopRepository.findByPoiId(poiId);
    }

    /**
     * 商户资料编辑
     * */
    public void edit(ShopEditForm form,String top_session){

        //根据top_session 获取对应的用户id
        int user_id = 87;
        //根据用户id编辑商户信息
        shopRepository.updateByPoiId(user_id,form);
    }
}
